﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CarShop.Domain.Entities;

namespace CarShop.Data.EntityFramework.Mappings
{
    internal class CarTypeConfiguration : EntityBaseConfiguration<CarType, int>
    {
        public CarTypeConfiguration()
        {
            Property(c => c.Name).IsRequired().HasMaxLength(50);

            HasMany(c => c.Cars).WithRequired(c => c.CarType).HasForeignKey(c => c.CarTypeId);
        }
    }
}
